#!/usr/bin/env python
# -*- coding: utf-8 -*-

__author__ = 'dong'


import re
from bs4 import BeautifulSoup

# with open('job.html', 'rb') as fd:
#     s = fd.read()
#     array = re.findall(r'\((.+?)\)', s)
#     print '['
#     for a in array:
#         print '    ['+a.decode('utf-8')+'], '
#     print ']'


job_list = [
    ["不限","10","96"],
    ["防护工程师（防化）","14","106"],
    ["防护工程师（防化）","15","114"],
    ["施工员","17","125"],
    ["一级消防工程师","16","123"],
    ["建筑工程","1","1"],
    ["建筑工程","2","11"],
    ["注册岩土","3","17"],
    ["一级建筑师","4","20"],
    ["一级结构师","5","22"],
    ["暖通空调","6","24"],
    ["供配电","7","27"],
    ["建设部","8","29"],
    ["建设部","9","32"],
    ["市政公用工程","10","35"],
    ["施工总承包资质","11","38"],
    ["工民建","12","44"],
    ["城市规划师","13","61"],
    ["化工工程师","13","62"],
    ["建筑/建筑施工","12","45"],
    ["园林绿化资质","11","39"],
    ["环境工程和生态建设","10","36"],
    ["水利部","9","33"],
    ["水利部","8","30"],
    ["发输变电","7","28"],
    ["给水排水","6","25"],
    ["二级结构师","5","23"],
    ["二级建筑师","4","21"],
    ["水利水电","3","18"],
    ["机电工程","2","12"],
    ["市政公用","1","2"],
    ["二级消防工程师","16","124"],
    ["质量员","17","126"],
    ["防护工程师（结构）","15","115"],
    ["防护工程师（结构）","14","107"],
    ["防护工程师（建筑）","14","108"],
    ["防护工程师（建筑）","15","116"],
    ["安全员","17","127"],
    ["机电工程","1","3"],
    ["市政公用工程","2","13"],
    ["港口航道","3","19"],
    ["动力","6","26"],
    ["交通部","8","31"],
    ["交通部","9","34"],
    ["建筑/建筑材料","10","37"],
    ["施工劳务分包资质","11","40"],
    ["水利水电","12","46"],
    ["环评工程师","13","63"],
    ["房地产估价师","13","64"],
    ["园林设计/园艺师","12","47"],
    ["施工专业承包资质","11","41"],
    ["水利水电工程","2","14"],
    ["公路工程","1","4"],
    ["资料员","17","128"],
    ["防护工程师（暖通）","15","117"],
    ["防护工程师（给排水）","14","109"],
    ["水电/核电/火电","10","80"],
    ["农业/林业","10","81"],
    ["防护工程师（暖通）","14","110"],
    ["防护工程师（电气）","15","118"],
    ["劳务员","17","129"],
    ["水利水电","1","5"],
    ["公路工程","2","15"],
    ["设计施工一体化","11","42"],
    ["给排水","12","48"],
    ["注册税务师","13","65"],
    ["注册会计师","13","66"],
    ["暖通/暖通空调/热处理","12","49"],
    ["矿业工程","2","16"],
    ["矿业工程","1","6"],
    ["监理员","17","130"],
    ["防护工程师（通信）","15","119"],
    ["防护工程师（电气）","14","111"],
    ["代办劳务分包资质","11","97"],
    ["化工、医药","10","82"],
    ["公路/铁路/民航","10","83"],
    ["代办企业资质","11","98"],
    ["防护工程师（防护设备）","14","112"],
    ["防护工程师（给排水）","15","120"],
    ["预算员","17","131"],
    ["港口与航道","1","7"],
    ["建设设计/测量","12","50"],
    ["环保工程师","13","67"],
    ["土地估价师","13","68"],
    ["市政/公路","12","51"],
    ["通信与广电","1","8"],
    ["机械员","17","132"],
    ["防护工程师（防护设备）","15","121"],
    ["防护工程师（通信）","14","113"],
    ["建筑企业资质升级","11","99"],
    ["机械/电子","10","84"],
    ["轻工/纺织、化纤","10","85"],
    ["建筑企业资质办理","11","101"],
    ["材料员","17","133"],
    ["铁路工程","1","9"],
    ["土建/造价","12","52"],
    ["爆破工程师","13","69"],
    ["安全评价师","13","70"],
    ["土木工程/道路与桥梁","12","53"],
    ["民航机场","1","10"],
    ["代办建委资质","11","103"],
    ["石油天然气","10","86"],
    ["城市规划","10","87"],
    ["代办资质证书","11","104"],
    ["经济师专业类","12","54"],
    ["安全工程师","13","71"],
    ["设备监理师","13","72"],
    ["建筑电气类","12","55"],
    ["资质申请/资质审批","11","105"],
    ["通信/广播电影电视","10","88"],
    ["地质/测量/岩土工程","10","89"],
    ["机械、自动化类","12","56"],
    ["资产评估师","13","73"],
    ["其他资质","11","43"],
    ["物业管理师","13","74"],
    ["船舶、冷冻类","12","57"],
    ["煤炭/石化","10","90"],
    ["城市轨道交通","10","91"],
    ["计算机、电子、通信","12","58"],
    ["质量工程师","13","75"],
    ["经济师","13","76"],
    ["装饰设计类","12","59"],
    ["钢铁/有色冶金","10","92"],
    ["综合经济","10","93"],
    ["其他证书","12","60"],
    ["概预算工程师","13","77"],
    ["招标师","13","78"],
    ["港口河海工程","10","94"],
    ["高级防护工程师","12","122"],
    ["电力/热能动力","12","135"],
    ["其他","10","95"],
    ["其他","13","79"],
    ["环保/规划","12","136"],
    ["注册测绘工程师","13","134"],
    ["环境工程","12","137"],
    ["化工","12","138"],
    ["总图","12","139"],
    ["能源工程","12","140"],
]


# soup = BeautifulSoup(open('c.html'), 'html.parser')
#
# option = soup.find_all('option')
# # print option
# # print option[0]
# for o in option:
#     # print o.string
#     # print o["value"]
#     print "\'%s\': %s," % (o.string, o["value"])


job_dict = {
    '一级建造师': 1,
    '二级建造师': 2,
    '土木工程师': 3,
    '建筑师': 4,
    '结构师': 5,
    '公用设备工程师': 6,
    '电气工程师': 7,
    '监理师': 8,
    '造价师': 9,
    '注册咨询师': 10,
    '资质办理与升级': 11,
    '职称证书': 12,
    '其他执业证书': 13,
    '一级防护工程师': 14,
    '二级防护工程师': 15,
    '注册消防工程师': 16,
    '八大员': 17,
}

data_list1 = {}
data_list2 = {}
data_list3 = {}
data_list4 = {}
data_list5 = {}
data_list6 = {}
data_list7 = {}
data_list8 = {}
data_list9 = {}
data_list10 = {}
data_list11 = {}
data_list12 = {}
data_list13 = {}
data_list14 = {}
data_list15 = {}
data_list16 = {}
data_list17 = {}


for i in job_list:
    # print i[0].decode('utf-8')
    # print i[1]
    # print i[2]

    # print type(i[1])
    if i[1] == '10' or i[1] == '11' or i[1] == '13' or i[1] == '14' or i[1] == '15' or i[1] == '16' or i[1] == '17':
        # print i[0].decode('utf-8')
        # print i[1]
        pass
    else:
        # self.checkBoxGroup_fo.addButton(self.obj.ui.checkBox_51guakao_1, 1)
        # print i[1]
        print """self.checkBoxGroup_fo.addButton(self.obj.ui.checkBox_51guakao_{0}, {1})""".format(i[2], i[2])


    # if i[1] == '1':
    #     data_list1[i[0]]=i[2]
    # elif i[1] == '2':
    #     data_list2[i[0]]=i[2]
    # elif i[1] == '3':
    #     data_list3[i[0]]=i[2]
    # elif i[1] == '4':
    #     data_list4[i[0]]=i[2]
    # elif i[1] == '5':
    #     data_list5[i[0]]=i[2]
    # elif i[1] == '6':
    #     data_list6[i[0]]=i[2]
    # elif i[1] == '7':
    #     data_list7[i[0]]=i[2]
    # elif i[1] == '8':
    #     data_list8[i[0]]=i[2]
    # elif i[1] == '9':
    #     data_list9[i[0]]=i[2]
    # elif i[1] == '10':
    #     data_list10[i[0]]=i[2]
    # elif i[1] == '11':
    #     data_list11[i[0]]=i[2]
    # elif i[1] == '12':
    #     data_list12[i[0]]=i[2]
    # elif i[1] == '13':
    #     data_list13[i[0]]=i[2]
    # elif i[1] == '14':
    #     data_list14[i[0]]=i[2]
    # elif i[1] == '15':
    #     data_list15[i[0]]=i[2]
    # elif i[1] == '16':
    #     data_list16[i[0]]=i[2]
    # elif i[1] == '17':
    #     data_list17[i[0]]=i[2]




# a_dict = {
#     1: '一级建造师',
#     2: '二级建造师',
#     3: '土木工程师',
#     4: '建筑师',
#     5: '结构师',
#     6: '公用设备工程师',
#     7: '电气工程师',
#     8: '监理师',
#     9: '造价师',
#     10: '注册咨询师',
#     11: '资质办理与升级',
#     12: '职称证书',
#     13: '其他执业证书',
#     14: '一级防护工程师',
#     15: '二级防护工程师',
#     16: '注册消防工程师',
#     17: '八大员',
# }

# print '# '+a_dict.get(1).decode('utf-8')
# print 'def city_1(self, value):'
# print '    data = {'
# for k,v in data_list1.iteritems():
#     print "        '" + k.decode('utf-8') + "': " + v + ', '
# print '    }'
# print '    return data.get(value)'
# print '\n'
#
# print '# '+a_dict.get(2).decode('utf-8')
# print 'def city_2(self, value):'
# print '    data = {'
# for k,v in data_list2.iteritems():
#     print "        '" + k.decode('utf-8') + "': " + v + ', '
# print '    }'
# print '    return data.get(value)'
# print '\n'
#
# print '# '+a_dict.get(3).decode('utf-8')
# print 'def city_3(self, value):'
# print '    data = {'
# for k,v in data_list3.iteritems():
#     print "        '" + k.decode('utf-8') + "': " + v + ', '
# print '    }'
# print '    return data.get(value)'
# print '\n'
#
# print '# '+a_dict.get(4).decode('utf-8')
# print 'def city_4(self, value):'
# print '    data = {'
# for k,v in data_list4.iteritems():
#     print "        '" + k.decode('utf-8') + "': " + v + ', '
# print '    }'
# print '    return data.get(value)'
# print '\n'
#
# print '# '+a_dict.get(5).decode('utf-8')
# print 'def city_5(self, value):'
# print '    data = {'
# for k,v in data_list5.iteritems():
#     print "        '" + k.decode('utf-8') + "': " + v + ', '
# print '    }'
# print '    return data.get(value)'
# print '\n'
#
# print '# '+a_dict.get(6).decode('utf-8')
# print 'def city_6(self, value):'
# print '    data = {'
# for k,v in data_list6.iteritems():
#     print "        '" + k.decode('utf-8') + "': " + v + ', '
# print '    }'
# print '    return data.get(value)'
# print '\n'
#
# print '# '+a_dict.get(7).decode('utf-8')
# print 'def city_7(self, value):'
# print '    data = {'
# for k,v in data_list7.iteritems():
#     print "        '" + k.decode('utf-8') + "': " + v + ', '
# print '    }'
# print '    return data.get(value)'
# print '\n'
#
# print '# '+a_dict.get(8).decode('utf-8')
# print 'def city_8(self, value):'
# print '    data = {'
# for k,v in data_list8.iteritems():
#     print "        '" + k.decode('utf-8') + "': " + v + ', '
# print '    }'
# print '    return data.get(value)'
# print '\n'
#
# print '# '+a_dict.get(9).decode('utf-8')
# print 'def city_9(self, value):'
# print '    data = {'
# for k,v in data_list9.iteritems():
#     print "        '" + k.decode('utf-8') + "': " + v + ', '
# print '    }'
# print '    return data.get(value)'
# print '\n'
#
# print '# '+a_dict.get(10).decode('utf-8')
# print 'def city_10(self, value):'
# print '    data = {'
# for k,v in data_list10.iteritems():
#     print "        '" + k.decode('utf-8') + "': " + v + ', '
# print '    }'
# print '    return data.get(value)'
# print '\n'
#
# print '# '+a_dict.get(11).decode('utf-8')
# print 'def city_11(self, value):'
# print '    data = {'
# for k,v in data_list11.iteritems():
#     print "        '" + k.decode('utf-8') + "': " + v + ', '
# print '    }'
# print '    return data.get(value)'
# print '\n'
#
# print '# '+a_dict.get(12).decode('utf-8')
# print 'def city_12(self, value):'
# print '    data = {'
# for k,v in data_list12.iteritems():
#     print "        '" + k.decode('utf-8') + "': " + v + ', '
# print '    }'
# print '    return data.get(value)'
# print '\n'
#
# print '# '+a_dict.get(13).decode('utf-8')
# print 'def city_13(self, value):'
# print '    data = {'
# for k,v in data_list13.iteritems():
#     print "        '" + k.decode('utf-8') + "': " + v + ', '
# print '    }'
# print '    return data.get(value)'
# print '\n'
#
# print '# '+a_dict.get(14).decode('utf-8')
# print 'def city_14(self, value):'
# print '    data = {'
# for k,v in data_list14.iteritems():
#     print "        '" + k.decode('utf-8') + "': " + v + ', '
# print '    }'
# print '    return data.get(value)'
# print '\n'
#
# print '# '+a_dict.get(15).decode('utf-8')
# print 'def city_15(self, value):'
# print '    data = {'
# for k,v in data_list15.iteritems():
#     print "        '" + k.decode('utf-8') + "': " + v + ', '
# print '    }'
# print '    return data.get(value)'
# print '\n'
#
# print '# '+a_dict.get(16).decode('utf-8')
# print 'def city_16(self, value):'
# print '    data = {'
# for k,v in data_list16.iteritems():
#     print "        '" + k.decode('utf-8') + "': " + v + ', '
# print '    }'
# print '    return data.get(value)'
# print '\n'
#
# print '# '+a_dict.get(17).decode('utf-8')
# print 'def city_17(self, value):'
# print '    data = {'
# for k,v in data_list17.iteritems():
#     print "        '" + k.decode('utf-8') + "': " + v + ', '
# print '    }'
# print '    return data.get(value)'
# print '\n'

# a_dict = dict((v, k) for k, v in job_dict.iteritems())
#
# for k, v in a_dict.iteritems():
#     print str(k) + ": '"+v.decode('utf-8')+"', "